<?php
namespace app\common\model;
use x\Xbase;
class Article extends Xbase
{

    /**
     * 文章列表
     * [lists description]
     * @param  array   $map   [description]
     * @param  integer $o     [description]
     * @param  integer $page  [description]
     * @param  integer $limit [description]
     * @return [type]         [description]
     */
    public function lists($map=[],$o=0,$page=1,$limit=10){
      $w = where($map);
      $order = "";
      switch($o){
        case 1: //综合排序
          $order = "order by sort desc,id desc";
          break;
      }
      $sql = "select * from article $w[0] {$order} ".limit($page,$limit);
      $rs = $this->db->query($sql,$w[1],'',true);
      return $rs;
    }

}
